//
//  UdpClient.h
//  socketDemo
//
//  Created by 吳瀾洲 on 2020/8/3.
//  Copyright © 2020 kingboyrang. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UdpConfigDefine.h"


@protocol UdpManagerDelegate <NSObject>

@optional
- (void)didSendDataWithTag:(long)tag status:(Boolean)success error:(NSError *_Nullable)error;

@end


NS_ASSUME_NONNULL_BEGIN

@interface UdpManager : NSObject

+ (UdpManager *)shareInstance;

@property(nonatomic,assign) id<UdpManagerDelegate> delegate;

//连接状态
@property (nonatomic,copy) UDPConnectStateChangedBlock connectStateChangedBlock;
//发送完成
@property (nonatomic,copy) UDPSendDataBlock sendDataBlock;

//发送数据
- (void)sendData:(NSData *)data port:(uint16_t)port toHost:(NSString *)host;
- (void)sendData:(NSData *)data port:(uint16_t)port toHost:(NSString *)host tag:(NSInteger)tag;




@end

NS_ASSUME_NONNULL_END
